﻿@model PlmPersonnelinfoViewModel
@{
    Layout = null;
    ViewBag.Title = "监理人员列表";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("select[name='input_section']").val("@ViewBag.input_section");
    });

</script>
<div class="pageContent" layouth="3">
@using (Html.BeginForm("SplitPageForPersonnel", "PlmPersonLeave", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return dwzSearch(this,'dialog');" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" id="flag" name="flag" value="@(ViewBag.flag)" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <input type="hidden" name="section" value="@(ViewBag.section)" />
    <ul class="searchBar">
        <li><span>姓名：</span>
            <input type="text" name="iput_name" value="@(ViewBag.iput_name)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
}

    <table class="table" width="100%" layouth="98" nowraptd="false" targettype="dialog">
        <thead>
            <tr>
                <th align="center">
                    编号
                </th>
                <th align="center">
                    标段
                </th>
                <th align="center">
                    姓名
                </th>
                <th align="center">
                    职位
                </th>
                <th align="center">
                    操作
                </th>
            </tr>
        </thead>
        <tbody>
            @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
            @foreach (var item in Model.ThePersonnelinfoList)
            {
                num += 1;
                <tr target="ids" rel="@item.Pi_Name">
                    <td>@item.Pi_Num
                    </td>
                    <td>@item.Pi_SectionName
                    </td>
                    <td>@item.Pi_Name
                    </td>
                    <td>@item.Pi_Post
                    </td>
                    <td>
                        <a class="btnSelect" href="javascript:unitSel('@item.Pi_Name','@item.Pi_ID')" title="选择">
                            选择</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar" style="border-bottom:none;">
        <div class="pages" style="float: right">
            <span>显示</span>
            <select class="comsplitpage" name="numPerPage" onchange="dialogPageBreak({numPerPage:this.value})">
                <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
            </select>
            <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
        </div>
        <div class="pagination" style="margin:0px;float:left; margin-left:25%" targetType="dialog" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="5" currentpage="@(ViewBag.pageNum)">
        </div>
    </div>
</div>
<script type="text/javascript">
    function unitSel(name, id) {
        var flag = $("#flag").val();
        if (flag == "leave") {
            $('input[name="PersonleaveInfo.Pl_PersonName"]').val(name);
            $('input[name="PersonleaveInfo.Pl_PersonID"]').val(id);
        } else {
            $('input[name="PersonleaveInfo.Pl_CoverMan"]').val(name);
        }
        $.bringBack()
    }
</script>
